package cn.cdeden.knowledge.service;


import cn.cdeden.common.core.domain.R;
import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.common.satoken.utils.LoginHelper;
import cn.cdeden.knowledge.domain.PersonalFilesTree;
import cn.cdeden.knowledge.domain.dto.FilesTree;
import cn.cdeden.knowledge.domain.dto.FilesTreeTop;
import cn.cdeden.knowledge.domain.dto.PersonalFilesTreeParam;
import cn.cdeden.knowledge.domain.dto.RecoverFileChooseAPath;
import cn.cdeden.knowledge.domain.vo.PersonalFilesTreeVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.undertow.util.BadRequestException;
import org.springframework.data.domain.Pageable;

import java.util.Collection;

public interface FileService {

    boolean setTreeTop(FilesTreeTop top);


    /**
     * @Description // 文件复制
     * @param chooseAPath
     * @return com.cdyd.ecm.resp.BaseRespResult
     **/
    R fileTreeCopy(RecoverFileChooseAPath chooseAPath) throws BadRequestException;


    /**
     * 创建富文本
     * @param parentId
     * @param folderName
     * @return
     */
    PersonalFilesTree createText(String parentId , String folderName);

    /**
     * @Description // 修改文件名
     * @param id
     * @param folderName
     * @return boolean
     **/
    boolean updateName(String id , String folderName) throws BadRequestException;


    boolean upDateFolderSizeUpDate(String userId, PersonalFilesTree filesTree, Long originalSize, Long newSize, String type);


    PersonalFilesTreeVo selectPersonalTree(String parentId) throws BadRequestException;

    PersonalFilesTree getPersonalFilesTree(String parentId, String id);




    /**
     * @Description // 文件移动
     * @param chooseAPath
     * @return com.cdyd.ecm.resp.BaseRespResult
     **/
    R fileTreeMove(RecoverFileChooseAPath chooseAPath) throws BadRequestException;



    /**
     * @Description // 修改备注
     * @Date 2022/12/28 10:50
     * @param id
     * @param remarks
     * @return boolean
     **/
    boolean updateRemarks(String id , String remarks) throws BadRequestException;


    PersonalFilesTreeVo selectPersonalTree(PersonalFilesTreeParam treeParam);


    boolean personalToEnterprise(Long fileId, String parentId, String fileName);


    PersonalFilesTreeVo selectPersonalTreePage(PersonalFilesTreeParam treeParam, Pageable pageable);


    TableDataInfo<PersonalFilesTreeVo> selectTreePage(PersonalFilesTreeParam query, Pageable pageable);

    IPage<PersonalFilesTree> selectFilesTree(Collection<String> ids, String fileNam, Pageable pageable);




//    boolean upDateFolderSizeUpDate(String userId, PersonalFilesTree filesTree, Long originalSize, Long newSize, String type) throws BadRequestException;

}
